package com.liu.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {
    private int code;
    private String msg;
    private Object data;

    public static R ok(int code,Object data){
        return new R(code,"OK",data);
    }
    public static R ok(Object data){
        return ok(200,data);
    }
    public static R ok(){
        return ok(null);
    }
    public static R fail(int code,String msg){
        return new R(code,msg,null);
    }
    public static R fail(String msg){
        return fail(400,msg);
    }

}
